{	Problem: http://codeforces.ru/problemset/problem/10/A
 	Verdict: Accepted
}
var n,p1,p2,p3,p4,t1,t2,r,p,i,x,y:longint; a:array[1..1010] of longint;
begin
read(n,p1,p2,p3,t1,t2);
p:=0;
r:=0;
for i:=1 to n do begin
  read(x,y);
  inc(r,(y-x)*p1);
  if p<>0 then begin
    dec(x,p);
    if x>t1 then begin
      inc(r,t1*p1);
      dec(x,t1);
      if x>t2 then begin
        inc(r,t2*p2);
        dec(x,t2);
        inc(r,x*p3);
      end else inc(r,x*p2);
    end else inc(r,x*p1);
  end;
  p:=y;
end;
write(r);
end.